<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var arr1 = [3,44,38,5,47,15,36,26,27,2,46,4,19,50,48];
        for(var i = 1; i < arr1.length; i++){
            for(var j = 0; j < arr1.length - i; j++){
                if(arr1[j] > arr1[j+1]){
                    var temp = arr1[j+1];
                    arr1[j+1] = arr1[j];
                    arr1[j] = temp;
                }
            }
        }
        console.log(arr1);
    </script>
</head>
<body>
    
</body>
</html>